UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '82PgmmCC75mthgUiFYGygeFVsGq5Hl3QJM2YUJVci6E='
WHERE
key_id = 'fc30cccff224db3fd274728e3f71f095d74867c33f698251bc023a6424a9b2d6'
AND (
token = '82PgmmCC75mthgUiFYGygeFVsGq5Hl3QJM2YUJVci6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)