UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z+ZnZCqzb4ezpSjXEvGMxJmapvamdcCvxv2TwTzmGz8='
WHERE
key_id = '898f54adebd43e67f428741c262728984fe7e1fad294202d6e0453a448b88f5d'
AND (
token = 'z+ZnZCqzb4ezpSjXEvGMxJmapvamdcCvxv2TwTzmGz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)