UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4JW6O7f1SFyMn53OPh9dzcRZ/DG05+8GhUjoYbqxy3s=' 
WHERE 
  key_id = 'b48d62036efd70ad3a0adc846abcbd783dfa61def466eef7138edd4c2d45d7c8' 
  AND (
    token = '4JW6O7f1SFyMn53OPh9dzcRZ/DG05+8GhUjoYbqxy3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031