UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sloGAg2IchP+R35cV5Tn8q2a3gP/tiqqJfMhM8t/eas='
WHERE
key_id = '1769c15499bfc01f0cc3dafa977ade01fcdc43d96d26dd33c66bef1743ebefb2'
AND (
token = 'sloGAg2IchP+R35cV5Tn8q2a3gP/tiqqJfMhM8t/eas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)