UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cwVVDGdt3VpwFxbiPNknhzGL9JIYm9aHJXiHrA/DpTs='
WHERE
key_id = '03bdbea91330e202731f4d36d80284f7e3263b579dc3bd174326abe470d9829e'
AND (
token = 'cwVVDGdt3VpwFxbiPNknhzGL9JIYm9aHJXiHrA/DpTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)