UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OSv0CemFtuXlVj4jbgR0EgzmCi5hSqRKwV4NEw36je4='
WHERE
key_id = 'f63175f6c012f89aa4a5b08cdb1b8a181020b32ab2e929f62d774a950dbbb9a9'
AND (
token = 'OSv0CemFtuXlVj4jbgR0EgzmCi5hSqRKwV4NEw36je4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)