UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x96U5VxSE4JLWY4rOFeGWv2aDx4Q6Ymg8i42fUrbU5c=' 
WHERE 
  key_id = 'e13b512a98678bd1510ea04894d7bcbf3efde1cc882730e19b34c43b480073b8' 
  AND (
    token = 'x96U5VxSE4JLWY4rOFeGWv2aDx4Q6Ymg8i42fUrbU5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020