UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FuujOtGJRKFTX0iCnqnWqntcM3MMcuLH/OdwXG6JTmc='
WHERE
key_id = '5dd89dc38e7aba5d9a96eaa1a5ac1791375ef7fbcdf5b25960e9f82afc240cd4'
AND (
token = 'FuujOtGJRKFTX0iCnqnWqntcM3MMcuLH/OdwXG6JTmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)