UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/kX5m+3dMr629t/AjPgcGt/JtF9edznLrOOoTL7tZBM='
WHERE
key_id = 'a33ab33112c9313cdb67a5bd1433d6190b0f410aa3f1dca7c825fb15bf0d95f5'
AND (
token = '/kX5m+3dMr629t/AjPgcGt/JtF9edznLrOOoTL7tZBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)