UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UzzQms3EClmD/dntvPaB5ViT51pCS7ORh+BJ6E74uuM=' 
WHERE 
  key_id = '11ac7146f16f12d7b94f76c30442b6f891227d1e292220a0fed93c0206513e9b' 
  AND (
    token = 'UzzQms3EClmD/dntvPaB5ViT51pCS7ORh+BJ6E74uuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015