UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+TU0rnLJka+oSk0iCoqoWmIEI73pzKOLk+fDm7QqxDw=' 
WHERE 
  key_id = '441ff65bd83d9c78f1fc8b95624a2c991c69e6859af81b3b8660328ec6234223' 
  AND (
    token = '+TU0rnLJka+oSk0iCoqoWmIEI73pzKOLk+fDm7QqxDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044