UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C7ZnsObiSNsMJ+guxg4OPbbTZEAR/3Oa1JVZJiBgamQ='
WHERE
key_id = '3cd345b4abc336665ea0a8f07be8124b9ed369424f235568a27345e1b5436744'
AND (
token = 'C7ZnsObiSNsMJ+guxg4OPbbTZEAR/3Oa1JVZJiBgamQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)