UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7bCBAlv7moUBev9piYJb5e7H63nLU3kb1RDZxCyMw0Q=' 
WHERE 
  key_id = 'fac40330840ab8e8ce532db5daa05bd1f6960ddeaba723d58779b8c7f7e3f6a6' 
  AND (
    token = '7bCBAlv7moUBev9piYJb5e7H63nLU3kb1RDZxCyMw0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016