UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGw9XrJjkhsRFBFIBG2gtt9PzQzB2XtG0Qb9TbTQ6UM='
WHERE
key_id = '3ac79a8e8a570a72c69b4e988a9c5a92f1bbd4da8df18f66c586a353453006bd'
AND (
token = 'wGw9XrJjkhsRFBFIBG2gtt9PzQzB2XtG0Qb9TbTQ6UM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)