UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '834Pdaax5xQc1OWVVWIEj3NsK+DsRt3tFDNsDr5gmD8=' 
WHERE 
  key_id = '614840d41737c801608b60ff4adbbe3c5c532dbda742cf4b55fa432cbe97f954' 
  AND (
    token = '834Pdaax5xQc1OWVVWIEj3NsK+DsRt3tFDNsDr5gmD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039