UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u74cIEPRpcvat1Gnh/l8dn1j2Sy2jQPKRfamszTPvK8='
WHERE
key_id = '357b39e0c7ebe25a386dd7c4dba9f58cd58ce66e3e384c177fb3693504072009'
AND (
token = 'u74cIEPRpcvat1Gnh/l8dn1j2Sy2jQPKRfamszTPvK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)