UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ezeF89vT/MQQcfTgvjYU6FS4493kx37CKZqgHz33zzI='
WHERE
key_id = 'a46e1fe8375f4d689f0ca026f936f4a9a85912322233b42279035f17714c6778'
AND (
token = 'ezeF89vT/MQQcfTgvjYU6FS4493kx37CKZqgHz33zzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)