UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CtgzEhbNodxTkKcSEvyF7tcYHfNr+PTXCTLCUtBfv3Q=' 
WHERE 
  key_id = '5c89f4bd1c4bcd6eaf33bc38defe4eb693588baf487c28f8394433f9ae886ae8' 
  AND (
    token = 'CtgzEhbNodxTkKcSEvyF7tcYHfNr+PTXCTLCUtBfv3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015