UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xl5lfg18xVbg6nUMfdefm7VZM7DOxW5OXOjmqAMq6Zc='
WHERE
key_id = '4bac92b6819bb5a837e9313072076df3c1c0605ae1abfee4d33527e80ac0c45f'
AND (
token = 'Xl5lfg18xVbg6nUMfdefm7VZM7DOxW5OXOjmqAMq6Zc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)