UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9zGwimBb1eiqDIM+S30s8RdzMkcmk01RjmcATTJQY2E=' 
WHERE 
  key_id = '7c565812169e68b2c62a7ab8dd97b7072666f788c1ac7782642f795d6b584b90' 
  AND (
    token = '9zGwimBb1eiqDIM+S30s8RdzMkcmk01RjmcATTJQY2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028