UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aPbBOh0z1ya8xq2vNjdxszw+0KG8WK0VUTGUEWcVMlw='
WHERE
key_id = '26888799b68c40d6c020df6fa4ba3f70464a40b1ebff580021068f1af47d0f14'
AND (
token = 'aPbBOh0z1ya8xq2vNjdxszw+0KG8WK0VUTGUEWcVMlw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)