UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3WZmRKCcQ+LLz5DlH9gtS6oipTiBZhob6OVAwDZQj4s=' 
WHERE 
  key_id = '2731e4adbbc91239c0b96d3929f3cfc13f42794c3cd79babd0f754897ec466a3' 
  AND (
    token = '3WZmRKCcQ+LLz5DlH9gtS6oipTiBZhob6OVAwDZQj4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028