UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D3WmANGBiKdVI2N5S+p1e2mpMSh2N8oq5ao5XimkalQ='
WHERE
key_id = '8b6fd8bd4a2c5a19ef6277eddb08971ec09db9a25daa2f6722762705370496fe'
AND (
token = 'D3WmANGBiKdVI2N5S+p1e2mpMSh2N8oq5ao5XimkalQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)