UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hqdUDae1V0a5br/kBivtFjVlmona4V2cEfuuXOoqKjQ=' 
WHERE 
  key_id = '8e2f75a7b3ade2a1974e4586726de4349788ce04d2e0c87b05fcbd7e26f7aec1' 
  AND (
    token = 'hqdUDae1V0a5br/kBivtFjVlmona4V2cEfuuXOoqKjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031