UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/HUUUE/bS25Rvae6jImQxe8bqmpnXoDbQfjHv0ksiRs='
WHERE
key_id = 'e36298f49659988eb0f903dd83a7bcf5e131ba0b0dc43fe4d7d2c29eb8f2ebc2'
AND (
token = '/HUUUE/bS25Rvae6jImQxe8bqmpnXoDbQfjHv0ksiRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)