UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tp11woSF00zNNyXPceUMm7SdV6mSJ7cDLkJyGPPj+nE=' 
WHERE 
  key_id = 'bcfdba73760074c123e5c1073a6d01be09b75ca083af81d7cccb373433dfcf92' 
  AND (
    token = 'Tp11woSF00zNNyXPceUMm7SdV6mSJ7cDLkJyGPPj+nE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018