UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2HcHeyJNP/8FCyvX33CyXs6UXwsCn+zF5gMjcfZTYo4=' 
WHERE 
  key_id = '9c55a690773a13be0e1f627e72f3809a75bd97709584ac829c9c279705450578' 
  AND (
    token = '2HcHeyJNP/8FCyvX33CyXs6UXwsCn+zF5gMjcfZTYo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013