UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3dILBJxpEOWvPcXuOFXqKYtOlLIHZNjv77DV5H+0Hjo=' 
WHERE 
  key_id = '9c518a5d83909befa19c7a41c5ffe6680e21c0b518d4db76f21280e7d406a6ea' 
  AND (
    token = '3dILBJxpEOWvPcXuOFXqKYtOlLIHZNjv77DV5H+0Hjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040