UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GhfSBltj2UtCmxQkYyRA0MXz+1iThRyr1k/bEXyxuNE='
WHERE
key_id = '7d566db55fe5fd8d5c9202413dcbc94f0623014770f7be14e6950a0f27b407bc'
AND (
token = 'GhfSBltj2UtCmxQkYyRA0MXz+1iThRyr1k/bEXyxuNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)