UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I43gAQlqWjE6PYHPO7uYZfiEg/7YaB0Mt0YrFZKPDGQ=' 
WHERE 
  key_id = '266ec9b2082b683fe47cf858065adcb40c2826a4e6019f4135be809ca282db88' 
  AND (
    token = 'I43gAQlqWjE6PYHPO7uYZfiEg/7YaB0Mt0YrFZKPDGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031