UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '00gzJXePWoqNVodhGW07JNLgMlFkhfbgsElSZcqoqoc='
WHERE
key_id = '019fb20b0cbf66710ece967e1f6577733f088bf186e2bef5ba81d6ca6fde3849'
AND (
token = '00gzJXePWoqNVodhGW07JNLgMlFkhfbgsElSZcqoqoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)