UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zyRWVlkumrKcD6HC0pouCdv35kRmtt6doke1h8RkNbk=' 
WHERE 
  key_id = '195cf0d48663d94647a9188c4f13e46c4fdea0e0277893d5ae43df53a532d603' 
  AND (
    token = 'zyRWVlkumrKcD6HC0pouCdv35kRmtt6doke1h8RkNbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020