UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0dPngAM9Uot6eB4vW7grOwq3QeB1VQ38XGGhZR1qmAs='
WHERE
key_id = '60c888f5ae8189cabd2b6f5236fce377263b63e4d1a689eec589a652b714df77'
AND (
token = '0dPngAM9Uot6eB4vW7grOwq3QeB1VQ38XGGhZR1qmAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)