UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/eT+Hmmc9u2KQCgWY6290c1/SZc67W954EPTCNB15BE=' 
WHERE 
  key_id = '0700c38f860061a881e1ff7ec4acca2aaa70d03f1846727396a09c7d550c47ed' 
  AND (
    token = '/eT+Hmmc9u2KQCgWY6290c1/SZc67W954EPTCNB15BE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023