UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dkpoyjX5FYnSYJKYe/BDbNgG3k9b7XyNnuqnsVS06zc=' 
WHERE 
  key_id = '9e094d9cb7b78a5fabde825f94c62eb025a8602c7ba7e5f8e00481a89f0cb8b7' 
  AND (
    token = 'dkpoyjX5FYnSYJKYe/BDbNgG3k9b7XyNnuqnsVS06zc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022