UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FbfpzELayfEhVuhedYeDe7NBXNVsO9v0vUkGojuTBg4='
WHERE
key_id = '36cc1860cf8294a5336079d19da352fe933debe4708c8df96c3458cffb455149'
AND (
token = 'FbfpzELayfEhVuhedYeDe7NBXNVsO9v0vUkGojuTBg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)