UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J/aG3adg2sfNL3yDxWwHVdIoyo2p0EofCHfVQJqZRG8=' 
WHERE 
  key_id = '3264c93c6e84e4909a5a50bcfbc900295691ff2e67d5bdd90f414f878c161c54' 
  AND (
    token = 'J/aG3adg2sfNL3yDxWwHVdIoyo2p0EofCHfVQJqZRG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040