UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EeC9g5Pedd+uCl8IaJjuRgzXZop1R4SkVwZSYylupO0=' 
WHERE 
  key_id = '9c1ef37e4b65b0046e7484f0510ba060b6a1623e8705039e8c70dcf79e11d983' 
  AND (
    token = 'EeC9g5Pedd+uCl8IaJjuRgzXZop1R4SkVwZSYylupO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017