UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3QDLBJ+bTzdL4iH0UIhccrwJubIr0Yd72CxRkXuaKs='
WHERE
key_id = '58767868edb6d2dd2c9167cbed089e4abe4d0dae270e917970dbe6da2943ed88'
AND (
token = 'e3QDLBJ+bTzdL4iH0UIhccrwJubIr0Yd72CxRkXuaKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)