UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mn3FB5Dtv/xes6Jy6aDkcHKjYEbDmUxx7r+YuCF/DJU='
WHERE
key_id = 'db2d2c3e456c782c19214f4214c77222f1507c77763dd71b3054c27657f3a2ad'
AND (
token = 'Mn3FB5Dtv/xes6Jy6aDkcHKjYEbDmUxx7r+YuCF/DJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)