UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0GWnE5ZxBUN7szMaFIlKrB7zjn9DOpzmvqGFnJTsq7s=' 
WHERE 
  key_id = 'b677c66972eb30cda3c91c2d71a4bea6c4686c0299951a5dfee4405c20e0e4a3' 
  AND (
    token = '0GWnE5ZxBUN7szMaFIlKrB7zjn9DOpzmvqGFnJTsq7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025