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

Query time 0.00028