UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k0+G3ktrPYI4/ephO43xdVDL/zlroosU79al2eVqTWM=' 
WHERE 
  key_id = '5c2ac45808d9e33eb59d02114d0ca9abb10dc5a623ee3d92906db8352c4a1299' 
  AND (
    token = 'k0+G3ktrPYI4/ephO43xdVDL/zlroosU79al2eVqTWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022