UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+PW46vqzNt4S8Y188Y0bfbqpmaPKYJOjEcua4O/E6Pg=' 
WHERE 
  key_id = 'ac0b072af55634dd8e1fdb797f96ee28a1e119510928b0113af00e64aacba212' 
  AND (
    token = '+PW46vqzNt4S8Y188Y0bfbqpmaPKYJOjEcua4O/E6Pg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042