UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '++XDgo6PtkwXA+h+sxQVGM+HyLr6dCn5RbWRZQ6EZ6Y=' 
WHERE 
  key_id = '2a636a5130b45899853b86db65ec48bd708853a293086c5605d5017a2486c752' 
  AND (
    token = '++XDgo6PtkwXA+h+sxQVGM+HyLr6dCn5RbWRZQ6EZ6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038