UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGg06RINcCQgfmoauv/c97vq+XJCwVkC0nLcSjfUPUM='
WHERE
key_id = '56b6e860b7c3f4f851d5149f518ef3065064dda2242ac838da7eb8cc9f28fbd6'
AND (
token = 'tGg06RINcCQgfmoauv/c97vq+XJCwVkC0nLcSjfUPUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)