UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GBB+60mcEqR2UOi8RrBShzLzZHzPBSfQ8hopGqjCHNA='
WHERE
key_id = 'babf86eb6097a232461e01ef7ea8d338bea041da55860f25bbbb590bdf5443b2'
AND (
token = 'GBB+60mcEqR2UOi8RrBShzLzZHzPBSfQ8hopGqjCHNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)