UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ZGEHMUQNHI9L/6A8ZzL9ND9aFM0X3+dA8adZBoOw88='
WHERE
key_id = 'd43c029f73855497e7a04c9535c4b54464ed51601c3b1555767dd2bdfdddf894'
AND (
token = '6ZGEHMUQNHI9L/6A8ZzL9ND9aFM0X3+dA8adZBoOw88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)