UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SkzvwBliGNgmd7kqHwqnCX55lxSRihCmQcPc4z50TwQ='
WHERE
key_id = '0b13e870c98ef18de8cee9db4afbffccdbd5494e6a8f68d22a4df1bfdae3ef59'
AND (
token = 'SkzvwBliGNgmd7kqHwqnCX55lxSRihCmQcPc4z50TwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)