UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4UMtxX5twmmiIdk1ZfQLdwM04Y9to71IUpqbd/c+0ks=' 
WHERE 
  key_id = '07c4375bf22318933b7430a6cd10dbbc8baa9c65f751b07e8c9b7a8b2c3b59fa' 
  AND (
    token = '4UMtxX5twmmiIdk1ZfQLdwM04Y9to71IUpqbd/c+0ks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045