UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sNSwXERIaNG01c34jYnlr6GvyYY7YjhWFD/60A3dG0U=' 
WHERE 
  key_id = 'ab2f76de926ed21bcf7b6f14521f5d6ed4f85e5cf1cc51f2ed8ea437b171a0f6' 
  AND (
    token = 'sNSwXERIaNG01c34jYnlr6GvyYY7YjhWFD/60A3dG0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023