UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a8lETpP9c5/xOyU3Lv8iw+iV795EFYPzv1jDMhlWdpY=' 
WHERE 
  key_id = '1a83d866e24fe35af7a39f2dc6813c5552ee7aaed6b1b4e72e237bf2f28dc975' 
  AND (
    token = 'a8lETpP9c5/xOyU3Lv8iw+iV795EFYPzv1jDMhlWdpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028