UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LTCrJ+Kkbtv9Eab542zEi+So/aNlN8wpSfUGIacyY+U='
WHERE
key_id = '0edb10bebdd4d0c8c86359b3b7baca8bd17d14d0c15e864c6e9b6b5b607b8171'
AND (
token = 'LTCrJ+Kkbtv9Eab542zEi+So/aNlN8wpSfUGIacyY+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)