UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zWSOk2xElKiJeeSgnN8CjEmT5nkvb9cDWBM5a5KFA58='
WHERE
key_id = '9dc9ac51bee6d8e27ff5036a753dce51810fee8d05b9f77815c6eb52f913cc52'
AND (
token = 'zWSOk2xElKiJeeSgnN8CjEmT5nkvb9cDWBM5a5KFA58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)