UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RM3g/X0zdfJTK2ag82E9S7r9JKYAmBUfWbhDKGMtOGY=' 
WHERE 
  key_id = '06dbcc704389ba09c1063d699eb154931f0e2f244095fd5fafee0ba2ad056b76' 
  AND (
    token = 'RM3g/X0zdfJTK2ag82E9S7r9JKYAmBUfWbhDKGMtOGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033