UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5b12breyPKn1tUYyctyD6Dyh5bktnChIVueEA7geCe4='
WHERE
key_id = 'a64ec900f1850c97cd7c2f6e43a52c90f35ab5c42f0e2d58e911c97b473a0373'
AND (
token = '5b12breyPKn1tUYyctyD6Dyh5bktnChIVueEA7geCe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)