UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VIt8PWrvHvt6CbDg11D2MvKN7Fq8NO/kKgDrrBognJw='
WHERE
key_id = 'c193f7fdb0001abd8520e66a4e211804f9fb6275dd54fdb44273eda439f6f454'
AND (
token = 'VIt8PWrvHvt6CbDg11D2MvKN7Fq8NO/kKgDrrBognJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)