UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qNBSh5UX6m7/aHrgKW+jyKJQrfwM9xVZn5mYOFGHMI8=' 
WHERE 
  key_id = '7aebae8a34b47496ba5074d7dd1333442c6c1441d1f3e8b48d7d7644747152b1' 
  AND (
    token = 'qNBSh5UX6m7/aHrgKW+jyKJQrfwM9xVZn5mYOFGHMI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016