UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9OduovOvvQK10afZIynZSn05LjqhiRCtUI2ylVEKKPg='
WHERE
key_id = '43c9807fb38599aa4e3a4fd37eee4c8b3884d4fbda4a2f3703a00c23c656a56c'
AND (
token = '9OduovOvvQK10afZIynZSn05LjqhiRCtUI2ylVEKKPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)