UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQ+miD/+6vU1fQVs2Za3I7stapLVzpfUJw//uaX8VFM='
WHERE
key_id = 'b189903db7b431552a045eb26860b1e4a81a1db950daf485c95a5480f97b915a'
AND (
token = 'UQ+miD/+6vU1fQVs2Za3I7stapLVzpfUJw//uaX8VFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)