UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cApMW+Ei/qBnJFmW8GW2hquqHD4SltA5SoQUxsDMf60='
WHERE
key_id = 'cab7ff613deb3a2933f88347d58949cc311b2779b3466b3049a1055ed09a9f49'
AND (
token = 'cApMW+Ei/qBnJFmW8GW2hquqHD4SltA5SoQUxsDMf60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)