UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UmbW0/0EyNReVEa+A/bba8uTRFrZhSblCYoThSbb9CQ=' 
WHERE 
  key_id = 'b47ea90d2d6b284aa6857b27362d696443d343a047d6dd820022d2d1d5c4afa2' 
  AND (
    token = 'UmbW0/0EyNReVEa+A/bba8uTRFrZhSblCYoThSbb9CQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037