UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hjyGd3d3KyeP4r+HU6oXeNFsIJFZTnuK9PY7tw+JNs4=' 
WHERE 
  key_id = 'c70570a60cce88847d2fb91a350e5d56b507b81879ea35a1616bc34dd30689fa' 
  AND (
    token = 'hjyGd3d3KyeP4r+HU6oXeNFsIJFZTnuK9PY7tw+JNs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051