UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZEeDTt85Eq87jO0DL1ft1ZxrrTwmpfUqrc9RK8/8VdA='
WHERE
key_id = 'de565cc6797a7d48fba47c50e3d168394b3b8bd0c17f4507db7654bcef9252e1'
AND (
token = 'ZEeDTt85Eq87jO0DL1ft1ZxrrTwmpfUqrc9RK8/8VdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)