UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xVt2q6gNXAiLPjnKTvBESW0mZ7CY4TCVu6GFdJUqW48=' 
WHERE 
  key_id = '448267ff3d8951958d1b9f766d1c956e4131ae07863a90b18c99e3d484e51c0b' 
  AND (
    token = 'xVt2q6gNXAiLPjnKTvBESW0mZ7CY4TCVu6GFdJUqW48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033